﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ConsolidationTool.Common.Entities;
using System.Collections.Generic;
using ConsolidationTool.Common;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using ConsolidationTool.WebParts.ControlTemplates;

using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;

namespace ConsolidationTool.WebParts.Layouts.CReport.Brochure
{
    public partial class P3KF : FSReportBase
    {

        public override ControlTemplates.CommonEntitySelector TopSelector
        {
            get
            {
                return commonEntitySelector as ControlTemplates.CommonEntitySelector;
            }
        }

     

        public override void GenerateReport_Click(object sender, EventArgs e)
        { 
            //邦定current月数据
            BindLastMonth(TopSelector.drpEntity.SelectedValue, TopSelector.yearTextBox.Text, TopSelector.monthTextBox.Text);
        }


        public override void ExportReport_Click(object sender, EventArgs e)
        {

            P6PL col01 = null;
            col01 = new P6PL();
            col01.row01 = Label01_Day1.Text;
            col01.row02 = Label02_Day1.Text;
            col01.row03 = Label03_Day1.Text;
            col01.row04 = Label04_Day1.Text;
            col01.row05 = Label05_Day1.Text;
            col01.row06 = Label06_Day1.Text;
            col01.row07 = Label07_Day1.Text;
            col01.row08 = Label08_Day1.Text;
            col01.row09 = Label09_Day1.Text;
            col01.row10 = Label10_Day1.Text;
            col01.row11 = Label11_Day1.Text;
            col01.row12 = Label12_Day1.Text;
            col01.row13 = Label13_Day1.Text;
            col01.row14 = Label14_Day1.Text;
            col01.row15 = Label15_Day1.Text;
            col01.row16 = Label16_Day1.Text;
            col01.row17 = Label17_Day1.Text;
            col01.row18 = Label18_Day1.Text;
            col01.row19 = Label19_Day1.Text;
            col01.row20 = Label20_Day1.Text;
            col01.row21 = Label21_Day1.Text;
            col01.row22 = Label22_Day1.Text;
            col01.row23 = Label23_Day1.Text;
            col01.row24 = Label24_Day1.Text;
            col01.row25 = Label25_Day1.Text;

            P6PL col02 = null;
            col02 = new P6PL();
            col02.row01 = Label01_Day2.Text;
            col02.row02 = Label02_Day2.Text;
            col02.row03 = Label03_Day2.Text;
            col02.row04 = Label04_Day2.Text;
            col02.row05 = Label05_Day2.Text;
            col02.row06 = Label06_Day2.Text;
            col02.row07 = Label07_Day2.Text;
            col02.row08 = Label08_Day2.Text;
            col02.row09 = Label09_Day2.Text;
            col02.row10 = Label10_Day2.Text;
            col02.row11 = Label11_Day2.Text;
            col02.row12 = Label12_Day2.Text;
            col02.row13 = Label13_Day2.Text;
            col02.row14 = Label14_Day2.Text;
            col02.row15 = Label15_Day2.Text;
            col02.row16 = Label16_Day2.Text;
            col02.row17 = Label17_Day2.Text;
            col02.row18 = Label18_Day2.Text;
            col02.row19 = Label19_Day2.Text;
            col02.row20 = Label20_Day2.Text;
            col02.row21 = Label21_Day2.Text;
            col02.row22 = Label22_Day2.Text;
            col02.row23 = Label23_Day2.Text;
            col02.row24 = Label24_Day2.Text;
            col02.row25 = Label25_Day2.Text;

            P6PL col03 = null;
            col03 = new P6PL();
            col03.row01 = Label01_Day3.Text;
            col03.row02 = Label02_Day3.Text;
            col03.row03 = Label03_Day3.Text;
            col03.row04 = Label04_Day3.Text;
            col03.row05 = Label05_Day3.Text;
            col03.row06 = Label06_Day3.Text;
            col03.row07 = Label07_Day3.Text;
            col03.row08 = Label08_Day3.Text;
            col03.row09 = Label09_Day3.Text;
            col03.row10 = Label10_Day3.Text;
            col03.row11 = Label11_Day3.Text;
            col03.row12 = Label12_Day3.Text;
            col03.row13 = Label13_Day3.Text;
            col03.row14 = Label14_Day3.Text;
            col03.row15 = Label15_Day3.Text;
            col03.row16 = Label16_Day3.Text;
            col03.row17 = Label17_Day3.Text;
            col03.row18 = Label18_Day3.Text;
            col03.row19 = Label19_Day3.Text;
            col03.row20 = Label20_Day3.Text;
            col03.row21 = Label21_Day3.Text;
            col03.row22 = Label22_Day3.Text;
            col03.row23 = Label23_Day3.Text;
            col03.row24 = Label24_Day3.Text;
            col03.row25 = Label25_Day3.Text;


            P6PL col04 = null;
            col04 = new P6PL();
            col04.row01 = Label01_Day4.Text;
            col04.row02 = Label02_Day4.Text;
            col04.row03 = Label03_Day4.Text;
            col04.row04 = Label04_Day4.Text;
            col04.row05 = Label05_Day4.Text;
            col04.row06 = Label06_Day4.Text;
            col04.row07 = Label07_Day4.Text;
            col04.row08 = Label08_Day4.Text;
            col04.row09 = Label09_Day4.Text;
            col04.row10 = Label10_Day4.Text;
            col04.row11 = Label11_Day4.Text;
            col04.row12 = Label12_Day4.Text;
            col04.row13 = Label13_Day4.Text;
            col04.row14 = Label14_Day4.Text;
            col04.row15 = Label15_Day4.Text;
            col04.row16 = Label16_Day4.Text;
            col04.row17 = Label17_Day4.Text;
            col04.row18 = Label18_Day4.Text;
            col04.row19 = Label19_Day4.Text;
            col04.row20 = Label20_Day4.Text;
            col04.row21 = Label21_Day4.Text;
            col04.row22 = Label22_Day4.Text;
            col04.row23 = Label23_Day4.Text;
            col04.row24 = Label24_Day4.Text;
            col04.row25 = Label25_Day4.Text;

            col04.row30 = LabelTitile00.Text;
            col04.row31 = LabelTitile01.Text;
            col04.row32 = LabelTitile02.Text;
            col04.row33 = LabelTitile03.Text;
            col04.row34 = LabelTitile04.Text;
            col04.row35 = LabelTitile05.Text;
            col04.row36 = LabelTitile06.Text;
            col04.row37 = LabelTitile07.Text;
            col04.row38 = LabelTon00.Text;
            col04.row39 = LabelTon01.Text;
            col04.row40 = LabelTitile08.Text;
            col04.row41 = LabelTitile09.Text;
            col04.row42 = LabelTitile10.Text;
            col04.row43 = LabelTitile11.Text;
            col04.row44 = LabelTitile12.Text;
            col04.row45 = LabelTitile13.Text;


            string fileName = TopSelector.yearTextBox.Text + TopSelector.monthTextBox.Text + Constants._Brochure_P3_PRIFIX + TopSelector.drpEntity.SelectedValue + ".xlsx";
            BusinessService.CreateP3Excel("", col01, col02, col03, col04, fileName);
            SPSite site = new SPSite(SPContext.Current.Site.ID);
            string reportUrl = site.Url + "/" + Constants._EXCEL_Library + "/" + fileName;
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Message", string.Format("<script>window.open('" + reportUrl + "');</script>"));

        }

        [Serializable]
        public class fsentity
        {
            public bool controlrow { get; set; }
            public bool datarow { get; set; }
            public bool insertcontrol { get; set; }
            public bool bold { get; set; }
            public string unit { get; set; }
            public string accountcode { get; set; }
            public string description { get; set; }
            public string Jan { get; set; }
            public string Feb { get; set; }
            public string Mar { get; set; }
            public string Apr { get; set; }
            public string May { get; set; }
            public string Jun { get; set; }
            public string Jul { get; set; }
            public string Aug { get; set; }
            public string Sep { get; set; }
            public string Oct { get; set; }
            public string Nov { get; set; }
            public string Dec { get; set; }
            public int digits { get; set; }
        }
        public class fsentityAc
        {
            public bool controlrow { get; set; }
            public bool datarow { get; set; }
            public bool insertcontrol { get; set; }
            public bool bold { get; set; }
            public string unit { get; set; }
            public string accountcode { get; set; }
            public string description { get; set; }
            public string YTDM_1 { get; set; }
            public string YTD { get; set; }
            public string CM { get; set; }
            public int digits { get; set; }
        }

        void BindLastMonth(string coCd, string year, string month)
        {
            Label01_Day1.Text = "0";
            Label02_Day1.Text = "0";
            Label03_Day1.Text = "0";
            Label04_Day1.Text = "0";
            Label05_Day1.Text = "0";
            Label06_Day1.Text = "0";
            Label07_Day1.Text = "0";
            Label08_Day1.Text = "0";
            Label09_Day1.Text = "0";
            Label10_Day1.Text = "0";
            Label11_Day1.Text = "0";
            Label12_Day1.Text = "0";
            Label13_Day1.Text = "0";
            Label14_Day1.Text = "0";
            Label15_Day1.Text = "0";
            Label16_Day1.Text = "0";
            Label17_Day1.Text = "0";
            Label18_Day1.Text = "0";
            Label19_Day1.Text = "0";
            Label20_Day1.Text = "0";
            Label21_Day1.Text = "0";
            Label22_Day1.Text = "0";
            Label23_Day1.Text = "0";
            Label24_Day1.Text = "0";
            Label25_Day1.Text = "0";

            Label01_Day2.Text = "0";
            Label02_Day2.Text = "0";
            Label03_Day2.Text = "0";
            Label04_Day2.Text = "0";
            Label05_Day2.Text = "0";
            Label06_Day2.Text = "0";
            Label07_Day2.Text = "0";
            Label08_Day2.Text = "0";
            Label09_Day2.Text = "0";
            Label10_Day2.Text = "0";
            Label11_Day2.Text = "0";
            Label12_Day2.Text = "0";
            Label13_Day2.Text = "0";
            Label14_Day2.Text = "0";
            Label15_Day2.Text = "0";
            Label16_Day2.Text = "0";
            Label17_Day2.Text = "0";
            Label18_Day2.Text = "0";
            Label19_Day2.Text = "0";
            Label20_Day2.Text = "0";
            Label21_Day2.Text = "0";
            Label22_Day2.Text = "0";
            Label23_Day2.Text = "0";
            Label24_Day2.Text = "0";
            Label25_Day2.Text = "0";

            Label01_Day3.Text = "0";
            Label02_Day3.Text = "0";
            Label03_Day3.Text = "0";
            Label04_Day3.Text = "0";
            Label05_Day3.Text = "0";
            Label06_Day3.Text = "0";
            Label07_Day3.Text = "0";
            Label08_Day3.Text = "0";
            Label09_Day3.Text = "0";
            Label10_Day3.Text = "0";
            Label11_Day3.Text = "0";
            Label12_Day3.Text = "0";
            Label13_Day3.Text = "0";
            Label14_Day3.Text = "0";
            Label15_Day3.Text = "0";
            Label16_Day3.Text = "0";
            Label17_Day3.Text = "0";
            Label18_Day3.Text = "0";
            Label19_Day3.Text = "0";
            Label20_Day3.Text = "0";
            Label21_Day3.Text = "0";
            Label22_Day3.Text = "0";
            Label23_Day3.Text = "0";
            Label24_Day3.Text = "0";
            Label25_Day3.Text = "0";

            Label01_Day4.Text = "0";
            Label02_Day4.Text = "0";
            Label03_Day4.Text = "0";
            Label04_Day4.Text = "0";
            Label05_Day4.Text = "0";
            Label06_Day4.Text = "0";
            Label07_Day4.Text = "0";
            Label08_Day4.Text = "0";
            Label09_Day4.Text = "0";
            Label10_Day4.Text = "0";
            Label11_Day4.Text = "0";
            Label12_Day4.Text = "0";
            Label13_Day4.Text = "0";
            Label14_Day4.Text = "0";
            Label15_Day4.Text = "0";
            Label16_Day4.Text = "0";
            Label17_Day4.Text = "0";
            Label18_Day4.Text = "0";
            Label19_Day4.Text = "0";
            Label20_Day4.Text = "0";
            Label21_Day4.Text = "0";
            Label22_Day4.Text = "0";
            Label23_Day4.Text = "0";
            Label24_Day4.Text = "0";
            Label25_Day4.Text = "0";

            string strCurrency = TopSelector.lbCompanyCurrency.Text;

            LabelTitile00.Text = strCurrency;
            LabelTitile01.Text = strCurrency;
            LabelTitile02.Text = strCurrency;
            LabelTitile03.Text = strCurrency;
            LabelTitile04.Text = strCurrency;
            LabelTitile05.Text = strCurrency;
            LabelTitile06.Text = strCurrency;
            LabelTitile07.Text = strCurrency;
            LabelTitile08.Text = strCurrency;
            LabelTitile09.Text = strCurrency;

            LabelTon00.Text = TopSelector.lbCompanyTonnage.Text;
            LabelTon01.Text = TopSelector.lbCompanyTonnage.Text;

            int m = Convert.ToInt32(TopSelector.monthTextBox.Text);

            int y_1 = Convert.ToInt32(year) - 1;
            string yearN_1 = Convert.ToString(y_1);

            int y_2 = Convert.ToInt32(year) - 2;
            string yearN_2 = Convert.ToString(y_2);

            string CurrMthDays = Common.BusinessService.GetMthDays(month, year);
            string CurrMthDaysN_1 = Common.BusinessService.GetMthDays(month, yearN_1);
            string CurrMthDaysN_2 = Common.BusinessService.GetMthDays(month, yearN_2);

            SPListItem itemPL = Common.BusinessService.GetItem(coCd, year, month, "P_L");
            SPListItem itemBudgetPL = Common.BusinessService.GetBudgetItem(coCd, year, "Budget_PL");
            SPListItem itemHR = Common.BusinessService.GetItem(coCd, year, month, "HR");
            SPListItem itemBudgetHR = Common.BusinessService.GetBudgetItem(coCd, year, "Budget_HR");
            SPListItem itemNF = Common.BusinessService.GetItem(coCd, year, month, "Actual_NF2");
            SPListItem itemBudgetNF = Common.BusinessService.GetBudgetItem(coCd, year, "Budget_NF2");
            SPListItem itemQS = Common.BusinessService.GetItem(coCd, year, month, "Quality&Safety");
            SPListItem itemBudgetQS = Common.BusinessService.GetBudgetItem(coCd, year, "Budget_QS");
            SPListItem itemCAPEX = Common.BusinessService.GetItem(coCd, year, month, "CAPEX");
            SPListItem itemBudgetCAPEX = Common.BusinessService.GetBudgetItem(coCd, year, "Budget_CAPEX");
            SPListItem itemIC = Common.BusinessService.GetItem(coCd, year, month, "Indirect Cash flow");
            SPListItem itemBudgetIC = Common.BusinessService.GetBudgetItem(coCd, year, "Budget_ICF");
            SPListItem itemBS = Common.BusinessService.GetItem(coCd, year, month, "Balance Sheet");
            SPListItem itemBudgetBS = Common.BusinessService.GetBudgetItem(coCd, year, "Budget_BS");

            if (itemBS != null)
            {
                Label06_Day3.Text = itemBS["CM_WC02010000"].ToString();
                //Label06_Day3.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(itemBS["CM_BS02010400"].ToString()));
                //Label06_Day3.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(itemBS["CM_BS02010500"].ToString()));
                //Label06_Day3.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(itemBS["CM_BS02010600"].ToString()));
                //Label06_Day3.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(itemBS["CM_BS02010601"].ToString()));
                //Label06_Day3.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(itemBS["CM_BS02010700"].ToString()));
                //Label06_Day3.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(itemBS["CM_BS02010800"].ToString()));
                //Label06_Day3.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(itemBS["CM_BS02010900"].ToString()));
                //Label06_Day3.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(itemBS["CM_BS02020400"].ToString()));
                //Label06_Day3.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(itemBS["CM_BS02020501"].ToString()));
                //Label06_Day3.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(itemBS["CM_BS02020601"].ToString()));
                //Label06_Day3.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(itemBS["CM_BS02020701"].ToString())); 
            }
            if (itemBudgetBS != null)
            {
                string billData = itemBudgetBS["BillData"].ToString();

                JavaScriptSerializer Serializer = new JavaScriptSerializer();

                List<fsentity> obj = Serializer.Deserialize<List<fsentity>>(billData);

                var objentity = obj as List<fsentity>;

                objentity.ForEach(p =>
                {
                    if (p.accountcode == "WC03010000")
                    {
                        switch (month)
                        {
                            case "1":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }
                    //if (p.accountcode == "BS03010400")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Feb.ToString()));
                    //            break;
                    //        case "3":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Mar.ToString()));
                    //            break;
                    //        case "4":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Apr.ToString()));
                    //            break;
                    //        case "5":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.May.ToString()));
                    //            break;
                    //        case "6":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jun.ToString()));
                    //            break;
                    //        case "7":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jul.ToString()));
                    //            break;
                    //        case "8":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Aug.ToString()));
                    //            break;
                    //        case "9":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Sep.ToString()));
                    //            break;
                    //        case "10":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Oct.ToString()));
                    //            break;
                    //        case "11":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Nov.ToString()));
                    //            break;
                    //        case "12":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Dec.ToString()));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                    //if (p.accountcode == "BS03010500")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Feb.ToString()));
                    //            break;
                    //        case "3":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Mar.ToString()));
                    //            break;
                    //        case "4":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Apr.ToString()));
                    //            break;
                    //        case "5":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.May.ToString()));
                    //            break;
                    //        case "6":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jun.ToString()));
                    //            break;
                    //        case "7":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jul.ToString()));
                    //            break;
                    //        case "8":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Aug.ToString()));
                    //            break;
                    //        case "9":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Sep.ToString()));
                    //            break;
                    //        case "10":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Oct.ToString()));
                    //            break;
                    //        case "11":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Nov.ToString()));
                    //            break;
                    //        case "12":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Dec.ToString()));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                    //if (p.accountcode == "BS03010600")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Feb.ToString()));
                    //            break;
                    //        case "3":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Mar.ToString()));
                    //            break;
                    //        case "4":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Apr.ToString()));
                    //            break;
                    //        case "5":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.May.ToString()));
                    //            break;
                    //        case "6":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jun.ToString()));
                    //            break;
                    //        case "7":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jul.ToString()));
                    //            break;
                    //        case "8":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Aug.ToString()));
                    //            break;
                    //        case "9":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Sep.ToString()));
                    //            break;
                    //        case "10":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Oct.ToString()));
                    //            break;
                    //        case "11":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Nov.ToString()));
                    //            break;
                    //        case "12":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Dec.ToString()));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                    //if (p.accountcode == "BS03010601")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Feb.ToString()));
                    //            break;
                    //        case "3":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Mar.ToString()));
                    //            break;
                    //        case "4":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Apr.ToString()));
                    //            break;
                    //        case "5":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.May.ToString()));
                    //            break;
                    //        case "6":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jun.ToString()));
                    //            break;
                    //        case "7":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jul.ToString()));
                    //            break;
                    //        case "8":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Aug.ToString()));
                    //            break;
                    //        case "9":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Sep.ToString()));
                    //            break;
                    //        case "10":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Oct.ToString()));
                    //            break;
                    //        case "11":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Nov.ToString()));
                    //            break;
                    //        case "12":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Dec.ToString()));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                    //if (p.accountcode == "BS03010700")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Feb.ToString()));
                    //            break;
                    //        case "3":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Mar.ToString()));
                    //            break;
                    //        case "4":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Apr.ToString()));
                    //            break;
                    //        case "5":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.May.ToString()));
                    //            break;
                    //        case "6":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jun.ToString()));
                    //            break;
                    //        case "7":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jul.ToString()));
                    //            break;
                    //        case "8":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Aug.ToString()));
                    //            break;
                    //        case "9":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Sep.ToString()));
                    //            break;
                    //        case "10":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Oct.ToString()));
                    //            break;
                    //        case "11":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Nov.ToString()));
                    //            break;
                    //        case "12":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Dec.ToString()));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                    //if (p.accountcode == "BS03010800")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Feb.ToString()));
                    //            break;
                    //        case "3":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Mar.ToString()));
                    //            break;
                    //        case "4":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Apr.ToString()));
                    //            break;
                    //        case "5":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.May.ToString()));
                    //            break;
                    //        case "6":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jun.ToString()));
                    //            break;
                    //        case "7":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jul.ToString()));
                    //            break;
                    //        case "8":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Aug.ToString()));
                    //            break;
                    //        case "9":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Sep.ToString()));
                    //            break;
                    //        case "10":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Oct.ToString()));
                    //            break;
                    //        case "11":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Nov.ToString()));
                    //            break;
                    //        case "12":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Dec.ToString()));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                    //if (p.accountcode == "BS03010900")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Feb.ToString()));
                    //            break;
                    //        case "3":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Mar.ToString()));
                    //            break;
                    //        case "4":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Apr.ToString()));
                    //            break;
                    //        case "5":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.May.ToString()));
                    //            break;
                    //        case "6":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jun.ToString()));
                    //            break;
                    //        case "7":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Jul.ToString()));
                    //            break;
                    //        case "8":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Aug.ToString()));
                    //            break;
                    //        case "9":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Sep.ToString()));
                    //            break;
                    //        case "10":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Oct.ToString()));
                    //            break;
                    //        case "11":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Nov.ToString()));
                    //            break;
                    //        case "12":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(p.Dec.ToString()));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                    //if (p.accountcode == "BS03020400")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Feb.ToString()));
                    //            break;
                    //        case "3":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Mar.ToString()));
                    //            break;
                    //        case "4":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Apr.ToString()));
                    //            break;
                    //        case "5":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.May.ToString()));
                    //            break;
                    //        case "6":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jun.ToString()));
                    //            break;
                    //        case "7":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jul.ToString()));
                    //            break;
                    //        case "8":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Aug.ToString()));
                    //            break;
                    //        case "9":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Sep.ToString()));
                    //            break;
                    //        case "10":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Oct.ToString()));
                    //            break;
                    //        case "11":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Nov.ToString()));
                    //            break;
                    //        case "12":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Dec.ToString()));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                    //if (p.accountcode == "BS03020500")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Feb.ToString()));
                    //            break;
                    //        case "3":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Mar.ToString()));
                    //            break;
                    //        case "4":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Apr.ToString()));
                    //            break;
                    //        case "5":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.May.ToString()));
                    //            break;
                    //        case "6":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jun.ToString()));
                    //            break;
                    //        case "7":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jul.ToString()));
                    //            break;
                    //        case "8":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Aug.ToString()));
                    //            break;
                    //        case "9":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Sep.ToString()));
                    //            break;
                    //        case "10":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Oct.ToString()));
                    //            break;
                    //        case "11":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Nov.ToString()));
                    //            break;
                    //        case "12":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Dec.ToString()));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                    //if (p.accountcode == "BS03020600")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Feb.ToString()));
                    //            break;
                    //        case "3":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Mar.ToString()));
                    //            break;
                    //        case "4":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Apr.ToString()));
                    //            break;
                    //        case "5":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.May.ToString()));
                    //            break;
                    //        case "6":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jun.ToString()));
                    //            break;
                    //        case "7":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jul.ToString()));
                    //            break;
                    //        case "8":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Aug.ToString()));
                    //            break;
                    //        case "9":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Sep.ToString()));
                    //            break;
                    //        case "10":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Oct.ToString()));
                    //            break;
                    //        case "11":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Nov.ToString()));
                    //            break;
                    //        case "12":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Dec.ToString()));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                    //if (p.accountcode == "BS03020700")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Feb.ToString()));
                    //            break;
                    //        case "3":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Mar.ToString()));
                    //            break;
                    //        case "4":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Apr.ToString()));
                    //            break;
                    //        case "5":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.May.ToString()));
                    //            break;
                    //        case "6":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jun.ToString()));
                    //            break;
                    //        case "7":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Jul.ToString()));
                    //            break;
                    //        case "8":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Aug.ToString()));
                    //            break;
                    //        case "9":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Sep.ToString()));
                    //            break;
                    //        case "10":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Oct.ToString()));
                    //            break;
                    //        case "11":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Nov.ToString()));
                    //            break;
                    //        case "12":
                    //            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) + Convert.ToDecimal(p.Dec.ToString()));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                });
            }

            if (itemIC != null)
            {
                Label08_Day3.Text = itemIC["CM_IC02080000"].ToString();
            }
            if (itemBudgetIC != null)
            {
                string billData = itemBudgetIC["BillData"].ToString();

                JavaScriptSerializer Serializer = new JavaScriptSerializer();

                List<fsentity> obj = Serializer.Deserialize<List<fsentity>>(billData);

                var objentity = obj as List<fsentity>;

                objentity.ForEach(p =>
                {
                    if (p.accountcode == "IC03080000")
                    {
                        switch (month)
                        {
                            case "1":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }

                });
            }

            for (int i = 1; i <= m; i++)
            {
                string strMonth = i.ToString();

                SPListItem itemCAPEXYTD = Common.BusinessService.GetItem(coCd, year, strMonth, "CAPEX");
                if (itemCAPEXYTD != null)
                {
                    Label07_Day3.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) + Convert.ToDecimal(itemCAPEXYTD["CM_FA02010000"].ToString()));

                }
            }
            if (itemBudgetCAPEX != null)
            {
                string billData = itemBudgetCAPEX["BillData"].ToString();

                JavaScriptSerializer Serializer = new JavaScriptSerializer();

                List<fsentity> obj = Serializer.Deserialize<List<fsentity>>(billData);

                var objentity = obj as List<fsentity>;

                objentity.ForEach(p =>
                {
                    if (p.accountcode == "FA03010000")
                    {
                        switch (month)
                        {
                            case "1":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }

                });
            }

            if (itemQS != null)
            {
                Label11_Day3.Text = itemQS["QS01010402"].ToString();
                Label11_Day4.Text = (BusinessService.decimalParse(itemQS["QS01010402"] + "") - BusinessService.GetBudgetValue(itemBudgetQS, "QS03010402", month)).ToString("n");  //modify by mike
                Label12_Day1.Text = itemQS["QS01020201"].ToString();

                Label12_Day2.Text = (BusinessService.decimalParse(itemQS["QS01020201"] + "") - BusinessService.GetBudgetValue(itemBudgetQS, "QS03020201", month)).ToString("n");
                Label13_Day2.Text = (BusinessService.decimalParse(itemQS["QS01030201"] + "") - BusinessService.GetBudgetValue(itemBudgetQS, "QS03030201", month)).ToString("n"); ;
                Label13_Day1.Text = itemQS["QS01030201"].ToString();
            }

            string Total1 = "0";
            string Total2 = "0";
            string Total3 = "0";
            string Total4 = "0";
            for (int i = 1; i <= m; i++)
            {
                string strMonth = i.ToString();

                SPListItem itemQSYTD = Common.BusinessService.GetItem(coCd, year, strMonth, "Quality&Safety");
                if (itemQSYTD != null)
                {
                    Total1 = Convert.ToString(Convert.ToDecimal(Total1) + Convert.ToDecimal(itemQSYTD["QS01020101"].ToString()));
                    Total2 = Convert.ToString(Convert.ToDecimal(Total2) + Convert.ToDecimal(itemQSYTD["QS01020102"].ToString()));
                    Total3 = Convert.ToString(Convert.ToDecimal(Total3) + Convert.ToDecimal(itemQSYTD["QS01030101"].ToString()));
                    Total4 = Convert.ToString(Convert.ToDecimal(Total4) + Convert.ToDecimal(itemQSYTD["QS01030102"].ToString()));
                }
            }

            if (Total1 == "0" || Total1 == "0.00")
            {
                Label12_Day3.Text = "0";
            }
            else
            {
                Label12_Day3.Text = ((Convert.ToDecimal(Total2) / Convert.ToDecimal(Total1)) * 100).ToString("n");
            }
            if (Total3 == "0" || Total3 == "0.00")
            {
                Label13_Day3.Text = "0";
            }
            else
            {
                Label13_Day3.Text = ((Convert.ToDecimal(Total4) / Convert.ToDecimal(Total3)) * 100).ToString("n");
            }


            string TotalYTD1 = "0";
            string TotalYTD2 = "0";
            string TotalYTD3 = "0";
            string TotalYTD4 = "0";

            if (itemBudgetQS != null)
            {
                string billData = itemBudgetQS["BillData"].ToString();

                JavaScriptSerializer Serializer = new JavaScriptSerializer();

                List<fsentity> obj = Serializer.Deserialize<List<fsentity>>(billData);

                var objentity = obj as List<fsentity>;

                objentity.ForEach(p =>
                {
                    if (p.accountcode == "QS01020101")
                    {
                        switch (month)
                        {
                            case "1":
                                TotalYTD1 = p.Jan.ToString();
                                break;
                            case "2":
                                TotalYTD1 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())).ToString();
                                break;
                            case "3":
                                TotalYTD1 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())).ToString();
                                break;
                            case "4":
                                TotalYTD1 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())).ToString();
                                break;
                            case "5":
                                TotalYTD1 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())).ToString();
                                break;
                            case "6":
                                TotalYTD1 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())).ToString();
                                break;
                            case "7":
                                TotalYTD1 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())).ToString();
                                break;
                            case "8":
                                TotalYTD1 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())).ToString();
                                break;
                            case "9":
                                TotalYTD1 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())).ToString();
                                break;
                            case "10":
                                TotalYTD1 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())).ToString();
                                break;
                            case "11":
                                TotalYTD1 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())).ToString();
                                break;
                            case "12":
                                TotalYTD1 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())).ToString();
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "QS01020102")
                    {
                        switch (month)
                        {
                            case "1":
                                TotalYTD2 = p.Jan.ToString();
                                break;
                            case "2":
                                TotalYTD2 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())).ToString();
                                break;
                            case "3":
                                TotalYTD2 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())).ToString();
                                break;
                            case "4":
                                TotalYTD2 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())).ToString();
                                break;
                            case "5":
                                TotalYTD2 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())).ToString();
                                break;
                            case "6":
                                TotalYTD2 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())).ToString();
                                break;
                            case "7":
                                TotalYTD2 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())).ToString();
                                break;
                            case "8":
                                TotalYTD2 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())).ToString();
                                break;
                            case "9":
                                TotalYTD2 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())).ToString();
                                break;
                            case "10":
                                TotalYTD2 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())).ToString();
                                break;
                            case "11":
                                TotalYTD2 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())).ToString();
                                break;
                            case "12":
                                TotalYTD2 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())).ToString();
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "QS01030101")
                    {
                        switch (month)
                        {
                            case "1":
                                TotalYTD3 = p.Jan.ToString();
                                break;
                            case "2":
                                TotalYTD3 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())).ToString();
                                break;
                            case "3":
                                TotalYTD3 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())).ToString();
                                break;
                            case "4":
                                TotalYTD3 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())).ToString();
                                break;
                            case "5":
                                TotalYTD3 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())).ToString();
                                break;
                            case "6":
                                TotalYTD3 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())).ToString();
                                break;
                            case "7":
                                TotalYTD3 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())).ToString();
                                break;
                            case "8":
                                TotalYTD3 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())).ToString();
                                break;
                            case "9":
                                TotalYTD3 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())).ToString();
                                break;
                            case "10":
                                TotalYTD3 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())).ToString();
                                break;
                            case "11":
                                TotalYTD3 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())).ToString();
                                break;
                            case "12":
                                TotalYTD3 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())).ToString();
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "QS01030102")
                    {
                        switch (month)
                        {
                            case "1":
                                TotalYTD4 = p.Jan.ToString();
                                break;
                            case "2":
                                TotalYTD4 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())).ToString();
                                break;
                            case "3":
                                TotalYTD4 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())).ToString();
                                break;
                            case "4":
                                TotalYTD4 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())).ToString();
                                break;
                            case "5":
                                TotalYTD4 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())).ToString();
                                break;
                            case "6":
                                TotalYTD4 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())).ToString();
                                break;
                            case "7":
                                TotalYTD4 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())).ToString();
                                break;
                            case "8":
                                TotalYTD4 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())).ToString();
                                break;
                            case "9":
                                TotalYTD4 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())).ToString();
                                break;
                            case "10":
                                TotalYTD4 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())).ToString();
                                break;
                            case "11":
                                TotalYTD4 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())).ToString();
                                break;
                            case "12":
                                TotalYTD4 = (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())).ToString();
                                break;
                            default:
                                break;
                        }
                    }
                });


                Label12_Day4.Text = (Convert.ToDecimal(Label12_Day3.Text) - Convert.ToDecimal(BusinessService.GetBudgetValue(itemBudgetQS, "QS03020201", month))).ToString("N2");

                Label13_Day4.Text = (Convert.ToDecimal(Label13_Day3.Text) - Convert.ToDecimal(BusinessService.GetBudgetValue(itemBudgetQS, "QS03030201", month))).ToString("N2");


            }

            if (itemNF != null)
            {
                string billData = itemNF["BillData"].ToString();

                JavaScriptSerializer Serializer = new JavaScriptSerializer();

                List<fsentityAc> obj = Serializer.Deserialize<List<fsentityAc>>(billData);

                var objentity = obj as List<fsentityAc>;

                objentity.ForEach(p =>
                {
                    if (p.accountcode == "NF02020100")
                    {
                        LabelTitile10.Text = p.unit.ToString();
                        Label22_Day1.Text = p.CM.ToString();
                        Label22_Day3.Text = p.YTD.ToString();
                    }
                    if (p.accountcode == "NF02020200")
                    {
                        LabelTitile11.Text = p.unit.ToString();
                        Label23_Day1.Text = p.CM.ToString();
                        Label23_Day3.Text = p.YTD.ToString();
                    }
                    if (p.accountcode == "NF02020300")
                    {
                        LabelTitile12.Text = p.unit.ToString();
                        Label24_Day1.Text = p.CM.ToString();
                        Label24_Day3.Text = p.YTD.ToString();
                    }
                    if (p.accountcode == "NF02020500")
                    {
                        LabelTitile13.Text = p.unit.ToString();
                        Label25_Day1.Text = p.CM.ToString();
                        Label25_Day3.Text = p.YTD.ToString();
                    }
                    if (p.accountcode == "NF02010100")
                    {
                        Label14_Day1.Text = p.CM.ToString();
                        Label14_Day3.Text = p.YTD.ToString();
                    }
                    if (p.accountcode == "NF02010200")
                    {
                        Label15_Day1.Text = p.CM.ToString();
                        Label15_Day3.Text = p.YTD.ToString();
                    }
                    if (p.accountcode == "NF02010300")
                    {
                        Label16_Day1.Text = p.CM.ToString();
                        Label16_Day3.Text = p.YTD.ToString();
                    }
                    if (p.accountcode == "NF02010400")
                    {
                        Label17_Day1.Text = p.CM.ToString();
                        Label17_Day3.Text = p.YTD.ToString();
                    }
                });
            }

            if (itemBudgetNF != null)
            {
                string billData = itemBudgetNF["BillData"].ToString();

                JavaScriptSerializer Serializer = new JavaScriptSerializer();

                List<fsentity> obj = Serializer.Deserialize<List<fsentity>>(billData);

                var objentity = obj as List<fsentity>;



                objentity.ForEach(p =>
                {
                    if (p.accountcode == "NF03020100")
                    {
                        switch (month)
                        {
                            case "1":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label22_Day2.Text = Convert.ToString(Convert.ToDecimal(Label22_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label22_Day4.Text = Convert.ToString(Convert.ToDecimal(Label22_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "NF03020200")
                    {
                        switch (month)
                        {
                            case "1":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label23_Day2.Text = Convert.ToString(Convert.ToDecimal(Label23_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label23_Day4.Text = Convert.ToString(Convert.ToDecimal(Label23_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "NF03020300")
                    {
                        switch (month)
                        {
                            case "1":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label24_Day2.Text = Convert.ToString(Convert.ToDecimal(Label24_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label24_Day4.Text = Convert.ToString(Convert.ToDecimal(Label24_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    //NF03020300(Jan)*NF03020100


                    //  BusinessService.GetBudgetYTDValue(itemBudgetNF, int.Parse(month), new string[] { "NF03020400", "NF03020100" }, "");

                    //if (p.accountcode == "NF03020500")
                    //{
                    //    switch (month)
                    //    {
                    //        case "1":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                    //            break;
                    //        case "2":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                    //            break;
                    //        case "3":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                    //            break;
                    //        case "4":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                    //            break;
                    //        case "5":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                    //            break;
                    //        case "6":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                    //            break;
                    //        case "7":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                    //            break;
                    //        case "8":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                    //            break;
                    //        case "9":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                    //            break;
                    //        case "10":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                    //            break;
                    //        case "11":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                    //            break;
                    //        case "12":
                    //            Label25_Day2.Text = Convert.ToString(Convert.ToDecimal(Label25_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                    //            Label25_Day4.Text = Convert.ToString(Convert.ToDecimal(Label25_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                    if (p.accountcode == "NF03010100")
                    {
                        switch (month)
                        {
                            case "1":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label14_Day2.Text = Convert.ToString(Convert.ToDecimal(Label14_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "NF03010200")
                    {
                        switch (month)
                        {
                            case "1":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label15_Day2.Text = Convert.ToString(Convert.ToDecimal(Label15_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "NF03010300")
                    {
                        switch (month)
                        {
                            case "1":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label16_Day2.Text = Convert.ToString(Convert.ToDecimal(Label16_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "NF03010400")
                    {
                        switch (month)
                        {
                            case "1":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label17_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                });

                //modify by mike
                var NF03020100 = BusinessService.GetBudgetYTDValue(itemBudgetNF, int.Parse(month), new string[] { "NF03020100" }, "");
                var NF03020400 = BusinessService.GetBudgetYTDValue(itemBudgetNF, int.Parse(month), new string[] { "NF03020400" }, "");
                var NF03020500 = BusinessService.GetBudgetValue(itemBudgetNF, "NF03020500", month);

                var NF03020400_NF03020100 = BusinessService.decimalParse(Utilities.Division(NF03020400 + "", NF03020100 + "", false));

                if (NF03020100 == 0)
                    Label24_Day4.Text = Label24_Day3.Text;
                else
                    Label24_Day4.Text = (Convert.ToDecimal(Label24_Day3.Text) -
                     BusinessService.GetBudgetYTDValue(itemBudgetNF, int.Parse(month), new string[] { "NF03020300", "NF03020100" }, "({0})*({1})") / NF03020100).ToString("N3");


                Label25_Day2.Text = Utilities.Division((Convert.ToDecimal(Label25_Day1.Text) - NF03020500).ToString(), NF03020500.ToString(), false);
                 

                if (NF03020400_NF03020100 != 0)
                {
                    Label25_Day4.Text = (
                        (Convert.ToDecimal(Label25_Day3.Text) - NF03020400_NF03020100)
                        / NF03020400_NF03020100).ToString("N3");
                }
                else
                {
                    Label25_Day4.Text = "0";
                }
            }

            if (itemHR != null)
            {
                Label10_Day1.Text = itemHR["HR01020100"].ToString();

            }

            for (int i = 1; i <= m; i++)
            {
                string strMonth = i.ToString();

                SPListItem itemHRYTD = Common.BusinessService.GetItem(coCd, year, strMonth, "HR");
                if (itemHRYTD != null)
                {
                    Label10_Day3.Text = Convert.ToString(Convert.ToDecimal(Label10_Day3.Text) + Convert.ToDecimal(itemHRYTD["HR01020100"].ToString()));

                }
            }
            Label10_Day3.Text = (Convert.ToDecimal(Label10_Day3.Text) / m).ToString("n");

            if (itemBudgetHR != null)
            {
                string billData = itemBudgetHR["BillData"].ToString();

                JavaScriptSerializer Serializer = new JavaScriptSerializer();

                List<fsentity> obj = Serializer.Deserialize<List<fsentity>>(billData);

                var objentity = obj as List<fsentity>;

                objentity.ForEach(p =>
                {
                    if (p.accountcode == "HR03020100")
                    {
                        switch (month)
                        {
                            case "1":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label10_Day4.Text = Convert.ToString(Convert.ToDecimal(Label10_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label10_Day4.Text = (Convert.ToDecimal(Label10_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())) / 2).ToString("n");
                                break;
                            case "3":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label10_Day4.Text = (Convert.ToDecimal(Label10_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())) / 3).ToString("n");
                                break;
                            case "4":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label10_Day4.Text = (Convert.ToDecimal(Label10_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())) / 4).ToString("n");
                                break;
                            case "5":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label10_Day4.Text = (Convert.ToDecimal(Label10_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())) / 5).ToString("n");
                                break;
                            case "6":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label10_Day4.Text = (Convert.ToDecimal(Label10_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())) / 6).ToString("n");
                                break;
                            case "7":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label10_Day4.Text = (Convert.ToDecimal(Label10_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())) / 7).ToString("n");
                                break;
                            case "8":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label10_Day4.Text = (Convert.ToDecimal(Label10_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())) / 8).ToString("n");
                                break;
                            case "9":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label10_Day4.Text = (Convert.ToDecimal(Label10_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())) / 9).ToString("n");
                                break;
                            case "10":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label10_Day4.Text = (Convert.ToDecimal(Label10_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())) / 10).ToString("n");
                                break;
                            case "11":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label10_Day4.Text = (Convert.ToDecimal(Label10_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())) / 11).ToString("n");
                                break;
                            case "12":
                                Label10_Day2.Text = Convert.ToString(Convert.ToDecimal(Label10_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label10_Day4.Text = (Convert.ToDecimal(Label10_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())) / 12).ToString("n");
                                break;
                            default:
                                break;
                        }
                    }
                });
            }

            if (itemPL != null)
            {
                Label01_Day1.Text = itemPL["CM_PL02010000"].ToString();
                Label02_Day1.Text = itemPL["CM_PL02040101"].ToString();
                Label03_Day1.Text = itemPL["CM_PL02050101"].ToString();
                Label04_Day1.Text = itemPL["CM_PL02060101"].ToString();
                Label05_Day1.Text = itemPL["CM_PL02080101"].ToString();
                Label09_Day1.Text = Convert.ToString(Convert.ToDecimal(itemPL["CM_PL02010101-1"] + ""));

                Label01_Day3.Text = Convert.ToString(Convert.ToDecimal(itemPL["CM_PL02010000"].ToString()) + Convert.ToDecimal(itemPL["YTDM1_PL02010000"].ToString()));
                Label02_Day3.Text = Convert.ToString(Convert.ToDecimal(itemPL["CM_PL02040101"].ToString()) + Convert.ToDecimal(itemPL["YTDM1_PL02040101"].ToString()));
                Label03_Day3.Text = Convert.ToString(Convert.ToDecimal(itemPL["CM_PL02050101"].ToString()) + Convert.ToDecimal(itemPL["YTDM1_PL02050101"].ToString()));
                Label04_Day3.Text = Convert.ToString(Convert.ToDecimal(itemPL["CM_PL02060101"].ToString()) + Convert.ToDecimal(itemPL["YTDM1_PL02060101"].ToString()));
                Label05_Day3.Text = Convert.ToString(Convert.ToDecimal(itemPL["CM_PL02080101"].ToString()) + Convert.ToDecimal(itemPL["YTDM1_PL02080101"].ToString()));
                Label09_Day3.Text = Convert.ToString((Convert.ToDecimal(itemPL["CM_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPL["YTDM1_PL02010101-1"].ToString())));
            }

            if (itemBudgetPL != null)
            {
                string billData = itemBudgetPL["BillData"].ToString();

                JavaScriptSerializer Serializer = new JavaScriptSerializer();

                List<fsentity> obj = Serializer.Deserialize<List<fsentity>>(billData);

                var objentity = obj as List<fsentity>;

                objentity.ForEach(p =>
                {
                    if (p.accountcode == "PL02010101-1")
                    {
                        switch (month)
                        {
                            case "1":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "PL03010000")
                    {
                        switch (month)
                        {
                            case "1":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label01_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "PL03040101")
                    {
                        switch (month)
                        {
                            case "1":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label02_Day2.Text = Convert.ToString(Convert.ToDecimal(Label02_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "PL03050101")
                    {
                        switch (month)
                        {
                            case "1":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label03_Day2.Text = Convert.ToString(Convert.ToDecimal(Label03_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "PL03060101")
                    {
                        switch (month)
                        {
                            case "1":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label04_Day2.Text = Convert.ToString(Convert.ToDecimal(Label04_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "PL03080101")
                    {
                        switch (month)
                        {
                            case "1":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label05_Day2.Text = Convert.ToString(Convert.ToDecimal(Label05_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "PL03010101-1")
                    {
                        switch (month)
                        {
                            case "1":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - Convert.ToDecimal(p.Jan.ToString()));
                                break;
                            case "2":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Feb.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString())));
                                break;
                            case "3":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Mar.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString())));
                                break;
                            case "4":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Apr.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString())));
                                break;
                            case "5":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.May.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString())));
                                break;
                            case "6":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Jun.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString())));
                                break;
                            case "7":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Jul.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString())));
                                break;
                            case "8":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Aug.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString())));
                                break;
                            case "9":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Sep.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString())));
                                break;
                            case "10":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Oct.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString())));
                                break;
                            case "11":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Nov.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString())));
                                break;
                            case "12":
                                Label09_Day2.Text = Convert.ToString(Convert.ToDecimal(Label09_Day1.Text) - Convert.ToDecimal(p.Dec.ToString()));
                                Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - (Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString())));
                                break;
                            default:
                                break;
                        }
                    }
                });
            }
        }



    }
}
